//TestPolymorphism.java
package com.xyc.ch5;
class Animal1
{
	public void speak()
	{
		System.out.println("Animal speak...");
	}
 }

class Dog extends Animal1
{
	public void speak()
	{
		System.out.println("Bowwow...");
	}
}

class Cat1 extends Animal1
{
	public void speak()
	{
		System.out.println("Meow...");
	}
}

public class TestPolymorphism
{
	public static void makeSpeak(Animal1 a)
	{
		a.speak();
	}
	public static void main(String[] args)
	{
		Cat1 c=new Cat1();
		Dog d=new Dog();
		makeSpeak(c);
		makeSpeak(d);
	}
}

